filemapping.htmlHTMLudog%πùΔ£πùΔ£Åņô Monkeybread Realbasic plugin - Documentation - Filemapping

MBS Plugin Documentation

This is the documentation for the Realbasic Plugins from Monkeybreadsoftware.de. You find these plugins and the newest version of this document at http://www.monkeybreadsoftware.de/realbasic inside the plugins section.

This help was last updated on Freitag, 6. September 2002 and covers 2136 items: 126 classes, 2 controls and 583 global functions.

The list of the themes Global methods by category Global methods by name The list of the classes The list of the controls

class Filemapping

class, Filemapping Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works partly. Windows: Works.
Function: Allows you to use File mapping.
Notes:
Filemapping is a clever way to map the content of a file into memory without loading it.
All applications are today loaded via mapping using the virtual memory manager. So your data is inside the file but some memory is used to cache it and you can access it as a memoryblock.

Known issues:

Works for Mac OS 9.1 using only one Object at the same time.
With Mac OS 9.2 and Windows you can use it as often as you like.
Not for Mac OS X now.

Close

method, Filemapping Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: Works.
Function: Closes the file mapping object.
Example: Close
Notes: Does nothing if no filemapping was done.

Error as integer

property, Filemapping Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: Works.
Function: Returns the last saved Mac OS Error code.
Example: msgbox str(f.error)

Memoryblock as Memoryblock

method, Filemapping Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: Works.
Function: Gives you a memoryblock for the filemapping object to use the memoryblock functions.
Example: m=f.Memoryblock
Notes: Usefull to use out CRC things with File mapping.

OpenFile(file as folderitem,size as integer,write as boolean) as boolean

method, Filemapping Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: Works.
Function: Creates a new filemapping object with given properties.
Example:
if OpenFile(file,100000000,true) then
' okay
else
' out of memory or even no Filemapping available
end if
Notes:
You can open a file with that.
Not yet implemented to handle that without OS help. But ask if you need this function on Mac OS X or Mac OS 8.

OpenScratchFile(volume as folderitem,size as integer,write as boolean) as boolean

method, Filemapping Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: Works.
Function: Creates a new filemapping object with given properties.
Example:
if OpenScratchFile(nil,100000000,true) then
' okay
else
' out of memory or even no Filemapping available
end if
Notes:
With volume you can tell on Mac OS 9 which volume will be used for the swapfile.
You can't grow a filemapping so use a big size if needed.
On Mac OS X and Carbon a normal memoryblock is used for this because there is till now no Carbon Filemapping API available.
On Windows the space comes allways from the normal swap file.

Reset

method, Filemapping Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: Works.
Function: Resets the file mapping object.
Example: f.Reset
Notes: Does a Close before if needed.

Size as integer

property, Filemapping Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: Works.
Function: Returns the current Size of the Filemapping object.
Example: msgbox str(f.size)+" Bytes"

Contact

Written 2002 by Christian Schmitz. Feel free to ask or report mistakes to realbasic@macsw.de.
Thanks.

This resource fork intentionally left blank ˇˇ